package y2018.date1116.rxjava;

import io.reactivex.Flowable;
import io.reactivex.functions.Consumer;
import org.junit.jupiter.api.Test;

/**
 * @author Yue
 */
public class HelloWorld {

    @Test
    public void main() throws Exception {

        test1();
//		test1 等于 test2 
        test2();
    }

    private static void test1() {
//		 lambdas表达式
        Flowable.just("Hello world!").subscribe(System.out::print);

    }

    private static void test2() {

        Flowable.just("Hello world!").subscribe(new Consumer<String>() {

            @Override
            public void accept(String arg0) throws Exception {
                System.out.println(arg0);

            }
        });
    }

}
